import java.util.ArrayList;


public class TableRecord {
	int status;
	String tableName;
	int numberOfFields;
	ArrayList<String> fieldNames;
	ArrayList<Integer> fieldSizes;
	int numberOfTotalIndexRecord;
	int numberOfTotalDataRecord;
	int sizeOfAnIndexRecord;
	int sizeOfADataRecord;
	int firstAvPageForDataRecord;
	int firstAvRecordForDataRecord;
	public TableRecord(){
		
	}
	public TableRecord(String tableName, int numberOfFields, ArrayList<String> fieldNames, ArrayList<Integer> fieldSizes){
		this.status = 1;
		this.tableName = tableName;
		this.numberOfFields = numberOfFields;
		this.fieldNames = fieldNames;
		this.fieldSizes = fieldSizes;
		this.firstAvPageForDataRecord = 0;
		this.firstAvRecordForDataRecord = 0;
		setOtherFieds();
	}
	public void setOtherFieds(){
		this.sizeOfAnIndexRecord = 2+fieldSizes.get(0);
		this.sizeOfADataRecord = 1;
		for(int i=0; i<numberOfFields; i++){
			this.sizeOfADataRecord += fieldSizes.get(i);
		}
		this.numberOfTotalIndexRecord = (512-1-fieldSizes.get(0))/sizeOfAnIndexRecord;
		this.numberOfTotalDataRecord = (512-1)/sizeOfADataRecord;
	}
	public int getStatus() {
		return status;
	}
	public String getTableName() {
		return tableName;
	}
	public int getNumberOfFields() {
		return numberOfFields;
	}
	public ArrayList<String> getFieldNames() {
		return fieldNames;
	}
	public ArrayList<Integer> getFieldSizes() {
		return fieldSizes;
	}
	public int getNumberOfTotalIndexRecord() {
		return numberOfTotalIndexRecord;
	}
	public int getNumberOfTotalDataRecord() {
		return numberOfTotalDataRecord;
	}
	public int getSizeOfAnIndexRecord() {
		return sizeOfAnIndexRecord;
	}
	public int getSizeOfADataRecord() {
		return sizeOfADataRecord;
	}
	public void setStatus(int status) {
		this.status = status;
	}
	public void setTableName(String tableName) {
		this.tableName = tableName;
	}
	public void setNumberOfFields(int numberOfFields) {
		this.numberOfFields = numberOfFields;
	}
	public void setFieldNames(ArrayList<String> fieldNames) {
		this.fieldNames = fieldNames;
	}
	public void setFieldSizes(ArrayList<Integer> fieldSizes) {
		this.fieldSizes = fieldSizes;
	}
	public void setNumberOfTotalIndexRecord(int numberOfTotalIndexRecord) {
		this.numberOfTotalIndexRecord = numberOfTotalIndexRecord;
	}
	public void setNumberOfTotalDataRecord(int numberOfTotalDataRecord) {
		this.numberOfTotalDataRecord = numberOfTotalDataRecord;
	}
	public void setSizeOfAnIndexRecord(int sizeOfAnIndexRecord) {
		this.sizeOfAnIndexRecord = sizeOfAnIndexRecord;
	}
	public void setSizeOfADataRecord(int sizeOfADataRecord) {
		this.sizeOfADataRecord = sizeOfADataRecord;
	}
	public void setFirstAvPageForDataRecord(int firstAvPageForDataRecord) {
		this.firstAvPageForDataRecord = firstAvPageForDataRecord;
	}
	public void setFirstAvRecordForDataRecord(int firstAvRecordForDataRecord) {
		this.firstAvRecordForDataRecord = firstAvRecordForDataRecord;
	}
	public int getFirstAvPageForDataRecord() {
		return firstAvPageForDataRecord;
	}
	public int getFirstAvRecordForDataRecord() {
		return firstAvRecordForDataRecord;
	}
}
